Xbasic

SQL::UpdateStatementGenerateNativeSyntax Method

Syntax

SQL_Statement as C = GenerateNativeSyntax([SQLConnection as SQL::Connection | SQLConnectionString as C])

Arguments

SQL_Statement

The native SQL equivalent of a Portable SQL expression.

SQL::UpdateStatement

A SQL::UpdateStatement object.

SQLConnection

Optional. A SQL::Connection object created with a DIM statement and with a defined .ConnectionString property.

SQLConnectionString

Optional. A connection string.

Description

Generate a native SQL statement using the selected syntax associated with the current or passed connection.

Discussion

The .GenerateNativeSyntax() method returns the native SQL version of the Portable SQL stored in the SQL::UpdateStatement.SQLStatement property.

Example

dim conn as SQL::Connection
dim connString as C
dim upd as SQL::UpdateStatement
dim sql_update as C
connString = "{A5API='Access', FileName='c:\program files\a5v7\mdbfiles\alphasports.mdb'}"
sql_update = "update customer set bill_city = 'Phoenix' where substring(bill_state,1,2) = 'AZ'"
? conn.open(connString)
= .T.
? upd.parse(sql_update)
= .T.
? upd.GenerateNativeSyntax(conn)
= "UPDATE customer SET bill_city = 'Phoenix'WHERE (Mid(bill_state, 1, 2) = 'AZ')"

See Also